//
//  WDTarget_GoutRescue.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/2.
//

#import "WDTarget_GoutRescue.h"
#import "WDGoutRescueViewController.h"
#import "WDGoutRescueItemViewController.h" // 不同分类的视图
#import "WDGoutWaitAssignViewController.h" // 工单界面-外出-待接单
#import "WDGrabOrdersPersonInfoViewController.h" // 抢单个人信息填写
#import "WDGoutWaitVehicleViewController.h" // 工单界面-外出救援-待接车
#import "WDGoutApplyCancelRescueViewController.h" // 工单界面-外出-待接车-申请取消救援
#import "WDGoutReviewVehicleViewController.h" // 工单界面-外出-检查中
#import "WDGoutMaintenanceVehicleViewController.h" // 工单界面-外出-维修中
#import "WDGoutPendingVehicleViewController.h" // 工单界面-外出-待报单
#import "WDGoutWaitAssignDetailViewController.h" // 工单界面-外出待分派-详情
#import "WDGoutWaitVehicleDetailViewController.h" // 外出救援-待接车-详情
#import "WDGoutWaitVehicleScanViewController.h" // 外出救援-待接车 - 接车扫码
#import "WDGoutReviewVehicleDetailViewController.h" // 工单界面-外出-检查中-详情
#import "WDGoutReviewVehicleScanCodeViewController.h" // 工单界面-外出-检查中-扫码
#import "WDGoutMaintenanceVehicleDetailViewController.h" // 工单界面-外出-维修中-详情
#import "WDGoutMaintenanceVehicleScanCodeViewController.h" // 工单界面-外出-维修中 - 扫码
#import "WDGoutPendingVehicleDetailViewController.h" // 工单界面-外出-待报单-详情
#import "WDGoutVehicleLocationViewController.h" // 车辆定位

#import "DoImagePickerViewController.h" // 选择图片
#import "EDSVideoCropViewController.h" // 录制的视频裁剪
#import "EDSVideoPreviewViewController.h" // 录制的视频预览
#import "EDSRecordVideoViewController.h" // 录制视频
#import "EDSCommunityPlayerViewController.h" // 视频播放




@implementation WDTarget_GoutRescue

/// 外出救援root
/// - Parameter params: params description
- (UIViewController *)action_rootGoutRescue:(nullable NSDictionary *)params {
    
    NSArray *subVC = [WDGoutRescueViewController setupViewControllers:@{}];
    NSArray *titles = [WDGoutRescueViewController setupMenuTitles];
    TYZPageConfigration *config = [WDGoutRescueViewController setupConfig];
    WDGoutRescueViewController *vc = [[WDGoutRescueViewController alloc] initPageWithControllers:subVC titles:titles config:config];
    
    return vc;
}

/// 不同分类的视图
/// - Parameter params: params description
- (UIViewController *)action_goutRescueItem:(NSDictionary *)params {
    WDGoutRescueItemViewController *vc = [[WDGoutRescueItemViewController alloc] init];
    vc.typeName = params[@"typeName"];
    vc.servFlow = [params[@"servFlow"] integerValue];
    return vc;
}

/// 工单界面-外出-待接单
/// - Parameter params: params description
- (UIViewController *)action_goutWaitAssign:(NSDictionary *)params {
    WDGoutWaitAssignViewController *vc = [[WDGoutWaitAssignViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
// #import "WDGoutWaitAssignViewController.h" // 工单界面-外出-待接单

/// 抢单个人信息填写
/// - Parameter params: params description
- (UIViewController *)action_grabOrdersPersonInfo:(NSDictionary *)params {
    WDGrabOrdersPersonInfoViewController *vc = [[WDGrabOrdersPersonInfoViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGrabOrdersPersonInfoViewController.h" // 抢单个人信息填写

/// 工单界面-外出救援-待接车
/// - Parameter params: params description
- (UIViewController *)action_grabWaitVehicle:(NSDictionary *)params {
    WDGoutWaitVehicleViewController *vc = [[WDGoutWaitVehicleViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
// #import "WDGoutWaitVehicleViewController.h" // 工单界面-外出救援-待接车

/// 工单界面-外出-待接车-申请取消救援
/// - Parameter params: params description
- (UIViewController *)action_grabApplyCancelRescue:(NSDictionary *)params {
    WDGoutApplyCancelRescueViewController *vc = [[WDGoutApplyCancelRescueViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutApplyCancelRescueViewController.h" // 工单界面-外出-待接车-申请取消救援

/// 工单界面-外出-检查中
/// - Parameter params: params description
- (UIViewController *)action_grabReviewVehicle:(NSDictionary *)params {
    WDGoutReviewVehicleViewController *vc = [[WDGoutReviewVehicleViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutReviewVehicleViewController.h" // 工单界面-外出-检查中

/// 工单界面-外出-维修中
/// @param params params description
- (UIViewController *)action_grabMaintenanceVehicle:(NSDictionary *)params {
    WDGoutMaintenanceVehicleViewController *vc = [[WDGoutMaintenanceVehicleViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutMaintenanceVehicleViewController.h" // 工单界面-外出-维修中

/// 工单界面-外出-待报单
/// @param params params description
- (UIViewController *)action_grabPendingVehicle:(NSDictionary *)params {
    WDGoutPendingVehicleViewController *vc = [[WDGoutPendingVehicleViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutPendingVehicleViewController.h" // 工单界面-外出-待报单

/**
 选择图片或者视频
 
 @param param @{@"selectPhotoNumType":@(1), @"photoNum":@(self.viewModel.dataList.count), @"isSelectImage":@(NO), @"selectPhotoBlock":block, @"ispush":@(NO)};
 @return return value description
 */
- (UIViewController *)action_choiceImagePicker:(NSDictionary *)param
{
    DoImagePickerViewController *imagePickerVC = [[DoImagePickerViewController alloc] init];
    imagePickerVC.selectPhotoNumType = [param[@"selectPhotoNumType"] intValue];
    imagePickerVC.photoNum = [param[@"photoNum"] integerValue];
    imagePickerVC.isSelectImage = [param[@"isSelectImage"] boolValue];
    imagePickerVC.selectPhotoBlock = param[@"selectPhotoBlock"];
    NSInteger maxNum = [param[@"maxNum"] integerValue];
    if (maxNum > 0) {
        imagePickerVC.maxNum = maxNum;
    }
    BOOL ispush = [param[@"ispush"] boolValue];
    if (ispush)
    {
        return imagePickerVC;
    }
    else
    {
        UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:imagePickerVC];
        return nav;
    }
}
// DoImagePickerViewController

/**
 录制事情视图控制器
 
 @param param @{@"completionBlock":nil, @"second":10, @"isLastTimeImage":yes}
 @return return value description
 */
- (UIViewController *)action_recordVideo:(NSDictionary *)param
{
    EDSRecordVideoViewController *recordVideoVC = [[EDSRecordVideoViewController alloc] init];
    recordVideoVC.completionBlock = param[@"completionBlock"];
    recordVideoVC.recordVideoSeconds = [param[@"second"] integerValue];
    recordVideoVC.isLastTimeImage = [param[@"isLastTimeImage"] boolValue];
    recordVideoVC.type = [param[@"type"] integerValue];
    return recordVideoVC;
}
// EDSRecordVideoViewController

/**
 视频裁剪视图控制器
 
 @param param {@"model":nil}
 @return return value description
 */
- (UIViewController *)action_videoCrop:(NSDictionary *)param
{
    EDSVideoCropViewController *videoCropVC = [[EDSVideoCropViewController alloc] init];
    videoCropVC.model = param[@"model"];
    return videoCropVC;
}
// EDSVideoCropViewController

/**
 视频预览
 
 @param param param {@"videoUrl":nil, @"removeVideoBlock":nil, @"isShowCrop":yes, @"model":nil}
 @return return value description
 */
- (UIViewController *)action_videoPreview:(NSDictionary *)param
{
    // void(^removeVideoBlock)(NSURL *videoUrl);
    EDSVideoPreviewViewController *videoVC = [[EDSVideoPreviewViewController alloc] init];
    videoVC.videoUrl = param[@"videoUrl"];
    videoVC.removeVideoBlock = param[@"removeVideoBlock"];
    videoVC.isShowCrop = [param[@"isShowCrop"] boolValue];
    videoVC.model = param[@"model"];
    return videoVC;
}
// EDSVideoPreviewViewController

/**
 社区的视图播放视图控制器
 
 @param param {@"videoUrl":nil}
 @return return value description
 */
- (UIViewController *)action_communityPlayer:(NSDictionary *)param
{
    EDSCommunityPlayerViewController *playerVC = [[EDSCommunityPlayerViewController alloc] init];
    playerVC.videoUrl = param[@"videoUrl"];
    return playerVC;
}
// EDSCommunityPlayerViewController

/// 工单界面-外出待分派-详情
/// @param params params description
- (UIViewController *)action_goutWaitAssignDetail:(NSDictionary *)params {
    WDGoutWaitAssignDetailViewController *vc = [[WDGoutWaitAssignDetailViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}

/// 外出救援-待接车-详情
/// @param params params description
- (UIViewController *)action_goutWaitVehicleDetail:(NSDictionary *)params {
    WDGoutWaitVehicleDetailViewController *vc = [[WDGoutWaitVehicleDetailViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutWaitVehicleDetailViewController.h" // 外出救援-待接车-详情

/// 外出救援-待接车 - 接车扫码
/// @param params params description
- (UIViewController *)action_goutWaitVehicleScan:(NSDictionary *)params {
    WDGoutWaitVehicleScanViewController *vc = [[WDGoutWaitVehicleScanViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.scanTitle = params[@"scanTitle"];
    vc.tipInfo = params[@"tipInfo"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutWaitVehicleScanViewController.h" // 外出救援-待接车 - 接车扫码

/// 工单界面-外出-检查中-详情
/// @param params params description
- (UIViewController *)action_goutReviewVehicleDetail:(NSDictionary *)params {
    WDGoutReviewVehicleDetailViewController *vc = [[WDGoutReviewVehicleDetailViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
// #import "WDGoutReviewVehicleDetailViewController.h" // 工单界面-外出-检查中-详情

/// 工单界面-外出-检查中-扫码
/// @param params params description
- (UIViewController *)action_goutReviewVehicleScanCode:(NSDictionary *)params {
    WDGoutReviewVehicleScanCodeViewController *vc = [[WDGoutReviewVehicleScanCodeViewController alloc] init];
    vc.scanTitle = params[@"scanTitle"];
    vc.tipInfo = params[@"tipInfo"];
    vc.serviceModel = params[@"serviceModel"];
    vc.reqModel = params[@"reqModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutReviewVehicleScanCodeViewController.h" // 工单界面-外出-检查中-扫码

/// 工单界面-外出-维修中-详情
/// @param params params description
- (UIViewController *)action_goutMaintenanceVehicleDetail:(NSDictionary *)params {
    WDGoutMaintenanceVehicleDetailViewController *vc = [[WDGoutMaintenanceVehicleDetailViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
// #import "WDGoutMaintenanceVehicleDetailViewController.h" // 工单界面-外出-维修中-详情

/// 工单界面-外出-维修中 - 扫码
/// @param params params description
- (UIViewController *)action_goutMaintenanceVehicleScanCode:(NSDictionary *)params {
    WDGoutMaintenanceVehicleScanCodeViewController *vc = [[WDGoutMaintenanceVehicleScanCodeViewController alloc] init];
    vc.scanTitle = params[@"scanTitle"];
    vc.tipInfo = params[@"tipInfo"];
    vc.serviceModel = params[@"serviceModel"];
    vc.reqModel = params[@"reqModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
// #import "WDGoutMaintenanceVehicleScanCodeViewController.h" // 工单界面-外出-维修中 - 扫码

/// 工单界面-外出-待报单-详情
/// @param params params description
- (UIViewController *)action_goutPendingVehicleDetail:(NSDictionary *)params {
    WDGoutPendingVehicleDetailViewController *vc = [[WDGoutPendingVehicleDetailViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutPendingVehicleDetailViewController.h" // 工单界面-外出-待报单-详情

/// 车辆定位
/// @param params params description
- (UIViewController *)action_goutVehicleLocation:(NSDictionary *)params {
    WDGoutVehicleLocationViewController *vc = [[WDGoutVehicleLocationViewController alloc] init];
    vc.serviceModel = params[@"serviceModel"];
    vc.popResultBlock = params[@"block"];
    return vc;
}
//#import "WDGoutVehicleLocationViewController.h" // 车辆定位


@end
